<template>
  <web-view :src="getToken"></web-view>
</template>

<script>
import { FIND_SHOP_URL } from '../../../api/shop-config'
export default {
  computed: {
    getToken () {
      return `https://akk.028wkf.cn/small-store/activity-list?token=${
        this.token
      }`
    }
  },
  onShow () {
    this.getShopUrl()
    console.log('token:', this.getToken)
  },
  data () {
    return {
      token: ''
    }
  },
  methods: {
    // vm.$store.state.account.shopId
    getShopUrl () {
      let shopId = this.$store.state.account.shopId
      let vm = this
      FIND_SHOP_URL({ shopId })
        .then(r => {
          if (r.data.code === '0') {
            this.token = r.data.data.split('?token=')[1]
          } else {
            vm.$toast(r.data.message)
          }
        })
        .catch(e => {
          console.error(e)
        })
    }
  }
}
</script>